package com.zoe.onelink.business.entity;


import com.zoe.onelink.business.excel.Excel;
import com.zoe.onelink.common.entity.IBaseEntity;
import com.zoe.onelink.util.CodeUtil;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>标题: 字典实体基类</p>
 * <p>描述: </p>
 * <p>版权: Copyright (c) 2016</p>
 * <p>公司: </p>
 *
 * @version: 1.0
 * @author: cxy
 * @date: 2017-03-10
 */
public class BaseDictEntity implements IBaseEntity, Serializable {

    private static final long serialVersionUID = 5716325847690147940L;

    @Excel(name = "有效标志", required = true)
    private String validFlag;//有效标志
    @Excel(name = "拼音码")
    private String spellCode;//拼音码
    @Excel(name = "五笔码")
    private String wbzxCode;//五笔码
    @Excel(name = "创建人")
    private String creatorCode;//创建人
    @Excel(name = "创建时间")
    private Date createdTime;//创建时间
    @Excel(name = "修改人")
    private String modifierCode;//修改人
    @Excel(name = "修改时间")
    private Date modifiedTime;//修改时间

    public String getValidFlag() {
        return validFlag;
    }

    public void setValidFlag(String validFlag) {
        this.validFlag = validFlag;
    }

    public String getSpellCode() {
        return spellCode;
    }

    public void setSpellCode(String spellCode) {
        this.spellCode = spellCode;
    }

    public String getWbzxCode() {
        return wbzxCode;
    }

    public void setWbzxCode(String wbzxCode) {
        this.wbzxCode = wbzxCode;
    }

    public String getCreatorCode() {
        return creatorCode;
    }

    public void setCreatorCode(String creatorCode) {
        this.creatorCode = creatorCode;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public String getModifierCode() {
        return modifierCode;
    }

    public void setModifierCode(String modifierCode) {
        this.modifierCode = modifierCode;
    }

    public Date getModifiedTime() {
        return modifiedTime;
    }

    public void setModifiedTime(Date modifiedTime) {
        this.modifiedTime = modifiedTime;
    }

    public void preInsert(String creator) {
        setCreatorCode(creator);
        setSpellCode(CodeUtil.cn2FirstSpell(""));
        setWbzxCode(CodeUtil.getWBCode(""));
    }

    public void preUpdate(String modifier) {
        setModifierCode(modifier);
    }
}
